<?php

/********************************************************/
/* CiroxX(tm)(c) v.5 Content Management System          */
/* ===========================================          */
/* Basecode (c) by Francisco Burzi                      */
/* Powered by: Coldcut (P.A.) webmaster@cybertipps.com  */
/* http://www.cybertipps.com                            */
/* Copyright © 2006 - 2012 by CT_Dev.                   */
/********************************************************/

if(!defined('CX_IS_FILE_DATABASE'))die('You can\'t access this file directly!');

$log_dir=CX_ROOTDIR."/".CX_LOGS_DIR."/dump_backup";
$contents.="<table summary=\"\" class=\"tab1\">\n";
$contents.="<thead>";
$contents.="<tr align=\"center\">\n";
$contents.="<td>".$lang_module['file_nb']."</td>\n";
$contents.="<td>".$lang_module['file_name']."</td>\n";
$contents.="<td>".$lang_module['file_site']."</td>\n";
$contents.="<td>".$lang_module['file_time']."</td>\n";
$contents.="<td></td>\n";$contents.="</tr>";
$contents.="</thead>";
$array_content=$array_time=array();
$files=scandir($log_dir);
foreach($files as $file){
if(preg_match("/^([a-zA-Z0-9]+)\_([a-zA-Z0-9\-\_]+)\.(sql|sql\.gz)+$/",$file,$mc)){
$filesize=filesize($log_dir.'/'.$file);
$filetime=intval(filemtime($log_dir.'/'.$file));
$array_time[]=$filetime;
$array_content[$filetime]=array("file"=>$file,'mc'=>$mc,"filesize"=>$filesize);
}
}
sort($array_time);
$a=1;
$count=sizeof($array_time)-1;
for($index=$count;$index>=0;--$index){
$filetime=$array_time[$index];
$value=$array_content[$filetime];
$file=$value['file'];
$mc=$value['mc'];
$link_getfile=CX_BASE_ADMINURL."index.php?".CX_NAME_VARIABLE."=".$module_name."&amp;".CX_OP_VARIABLE."=getfile&amp;filename=".$file."&amp;checkss=".md5($file.$client_info['session_id'].$global_config['sitekey']);
$link_delete=CX_BASE_ADMINURL."index.php?".CX_NAME_VARIABLE."=".$module_name."&amp;".CX_OP_VARIABLE."=delfile&amp;filename=".$file."&amp;checkss=".md5($file.$client_info['session_id'].$global_config['sitekey']);
$class=($a%2==0)?"":" class=\"second\"";
$contents.="<tbody".$class.">";
$contents.="<tr>\n";
$contents.="<td align=\"center\">".++$a."</td>\n";
$contents.="<td>".$mc[2].".".$mc[3]."</td>\n";
$contents.="<td align=\"right\">".cx_convertfromBytes($value['filesize'])."</td>\n";
$contents.="<td align=\"right\">".cx_date("l d-m-Y h:i:s A",$filetime)."</td>\n";
$contents.="<td align=\"center\">\n\t\t\t\t<span class=\"default_icon\"><a href=\"".$link_getfile."\">".$lang_module['download']."</a></span>\n\t\t\t\t - \n\t\t\t\t<span class=\"delete_icon\"><a onclick=\"return confirm(cx_is_del_confirm[0]);\" href=\"".$link_delete."\">".$lang_global['delete']."</a></span>\n\t\t\t\t</td>\n";
$contents.="</tr>";
$contents.="</tbody>";
}
$contents.="</table>\n";
$page_title=$lang_module['file_backup'];
include(CX_ROOTDIR."/includes/header.php");
echo cx_admin_theme($contents);
include(CX_ROOTDIR."/includes/footer.php");

?>